using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Routing;
using Thor.Models;
using Thor.WebRole.Services;
using Thor.Common;
using Thor.Domain;
using Thor.Domain.Configuration;

namespace Thor.WebRole.Controllers
{
    public class CurrentAvailabilityController : AuthenticatedController
    {
        public ActionResult Index(string id)
        {
            var result = this.CurrentAvailabiltyAuthenticationRequired(id);

            if (result != null)
                return result;

            var svc = new TimeZoneDomainService();
            var timeZone = svc.GetCalendarTimeZone(id);
            var model = new CurrentAvailabilityTimeZone(timeZone, id);

            return View("Details", model);
        }
    }
}
